package com.vilinno.tlias.pojo;

import lombok.Data;

@Data
public class Result {

    //状态码，1为成功，0为失败
    private Integer code;

    private String msg;
    private Object data;

    public static Result success(){
        Result result = new Result();
        result.setCode(1);
        result.setMsg("success");
        return result;
    }

    public static Result success(Object object){
        Result result = new Result();
        result.setCode(1);
        result.setMsg("success");
        result.setData(object);
        return result;
    }

    public static Result error(String msg){
        Result result = new Result();
        result.setCode(0);
        result.setMsg(msg);
        return result;
    }

}
